package main
import (
    "fmt"
    "math"
)
func main() {
    sum:=0;
    fmt.Println("sum for1:",for1(sum))
    fmt.Println("sum for2:",for2())
    if1(2)
    fmt.Println(if2(3,2,10))
    fmt.Println(
        if3(3,2,10),
        if3(3,3,20),
    )
    fmt.Println(
        "hello",
        "world",
    )
}

func for1(sum int) int{
    for i:=0;i<10;i++{
        sum+=i
    }
    return sum
}

func for2() int{
    i:=4
    for ;i<1000;{
        i+=i
    }
    return  i
}

func if1(param int){
    if param>0{
        fmt.Println(">0")
    }else {
        fmt.Println("<0")
    }
}

func if2(x,n,lim float64) float64{
    if v:=math.Pow(x,n);v<lim{
        return v
    }
    return lim
}

func if3(x,n,lim float64) float64{
    if v:=math.Pow(x,n);v<lim{
        return v
    }else {
        fmt.Printf("%g >= %g\n",v,lim)
    }
    return lim
}